 package org.example.datasource.eventhandler;

import javax.annotation.PostConstruct;

import org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent;
import org.example.datasource.Disorder;
import org.springframework.stereotype.Component;

import com.alibaba.otter.canal.connector.core.consumer.CommonMessage;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Component
public class InsertHandler  extends AbstractEventHandler implements Disorder{

    private final String name = "INSERT";
    
    //
    
    @PostConstruct
    public void init() {
        register(name, this);
        subscribe(name);
    }
    
    @Override
    public void hand(CommonMessage msg) {
        log.info("insert=>{}",msg.getTable());
    }

    @Override
    public void updatedNode(PathChildrenCacheEvent event) {
//        ChildData child = event.getData();
    }

    @Override
    public void deletedNode(PathChildrenCacheEvent event) {
//        ChildData child = event.getData();
    }

    @Override
    public void addedNode(PathChildrenCacheEvent event) {
    }

}
